<template>
  <div class="row justify-content-center">
    <div class="col-lg-5 col-md-7">
      <div class="card bg-secondary shadow border-0">
        <!-- <div class="card-header bg-transparent pb-5">
          <div class="text-muted text-center mt-2 mb-3">
            <small>Sign in with</small>
          </div>
          <div class="btn-wrapper text-center">
            <a href="#" class="btn btn-neutral btn-icon">
              <span class="btn-inner--icon"
                ><img src="img/icons/common/github.svg"
              /></span>
              <span class="btn-inner--text">Github</span>
            </a>
            <a href="#" class="btn btn-neutral btn-icon">
              <span class="btn-inner--icon"
                ><img src="img/icons/common/google.svg"
              /></span>
              <span class="btn-inner--text">Google</span>
            </a>
          </div>
        </div> -->
        <div class="card-body px-lg-5 py-lg-5">
          <form role="form">
            <base-input
              formClasses="input-group-alternative mb-3"
              placeholder="部门"
              addon-left-icon="ni ni-building"
              v-model="model.department"
            >
            </base-input>
            <base-input
              formClasses="input-group-alternative mb-3"
              placeholder="姓名"
              addon-left-icon="ni ni-single-02"
              v-model="model.username"
            >
            </base-input>
            <div class="text-muted">
              <small>仅在本地缓存以上信息</small>
            </div>
            <div class="text-center">
              <base-button type="primary" class="my-4" @click="submit">
                登入
              </base-button>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "login",
  data() {
    return {
      model: {
        department: "",
        username: "",
      },
    };
  },
  methods: {
    submit: function () {
      console.log(this.model.user);
      localStorage.setItem("user", JSON.stringify(this.model));
      this.$router.push("/");
    },
  },
};
</script>
<style></style>
